//
//  SubfieldCollectionViewCell.swift
//  koolcar
//
//  Created by kuaimaxiansheng on 2023/10/9.
//

import UIKit

class SubfieldCollectionViewCell: UICollectionViewCell {
    var titleLab: UILabel!
    var imageView: UIImageView!
    override init(frame: CGRect) {
        super.init(frame: frame)
        self.backgroundColor = .white
        self.clipsToBounds = true
        
        self.titleLab = UILabel(frame: .zero)
        self.titleLab.font = UIFont(name: Theme.PingFangSCMedium, size: 14)
        self.titleLab.textColor = Theme.mainColor
        self.titleLab.textAlignment = .center
        self.contentView.addSubview(self.titleLab)
        
        
        self.imageView = UIImageView(frame: .zero)
        self.imageView.image = UIImage(named: "icon_subfield")
        self.contentView.addSubview(self.imageView)
        
        self.titleLab.snp.makeConstraints { make in
            make.top.equalTo(0)
            make.left.equalTo(5)
            make.right.equalTo(-5)
            make.height.equalTo(20)
        }
        
        
        self.imageView.snp.makeConstraints { make in
            make.top.equalTo(self.titleLab.snp.bottom)
            make.width.equalTo(21)
            make.centerX.equalTo(self.titleLab.snp.centerX)
            make.height.equalTo(6)
        }
        
    }
    
    
    
    required init?(coder: NSCoder) {
        fatalError("init(coder:) has not been implemented")
    }
    
}
